 
import ls from '@/lib/ls'

const hasRoleShow = {
  mounted(el, binding) { 
    const userRoleALL = ls.get('USER_ROLE_ALL')
    const userRole = userRoleALL.map(item => item.name); // ['admin','user','editor']   
    if (!userRole.includes(binding.value)) {
      el.style.pointerEvents = 'none'; 
      el.style.cursor = 'not-allowed'
      el.style.color = '#ccc'
      el.style.backgroundColor = '#e6e6e6' 
      // el.style.opacity = '0.5'  
    }
  }
};

export default hasRoleShow; 
 